const ModulesFile = import.meta.glob('./*.js', { eager: true })

// 路由集合
const RouterList = []

Object.values(ModulesFile).map((mod) => {
    if (mod.default) {
        RouterList.push(...mod.default);
    }
})

//定义父组件
const layout = {
    template: ` <router-view></router-view>`
}

export default [
    {
        path: '/product',
        component: layout,
        //子路由分组 
        children: RouterList
    }
]